package com.taoxi.good.service.Impl;

import com.taoxi.common.utils.DateUtils;
import com.taoxi.good.domain.GoodSku;
import com.taoxi.good.mapper.GoodSkuMapper;
import com.taoxi.good.service.IGoodSkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * sku管理testService业务层处理
 *
 * @author ruoyi
 * @date 2024-10-21
 */
@Service
public class GoodSkuServiceImpl implements IGoodSkuService {
    @Autowired
    private GoodSkuMapper goodSkuMapper;

    /**
     * 查询sku管理test
     *
     * @param id sku管理test主键
     * @return sku管理test
     */
    @Override
    public GoodSku selectGoodSkuById(Long id) {
        return goodSkuMapper.selectGoodSkuById(id);
    }

    /**
     * 查询sku管理test列表
     *
     * @param goodSku sku管理test
     * @return sku管理test
     */
    @Override
    public List<GoodSku> selectGoodSkuList(GoodSku goodSku) {
        return goodSkuMapper.selectGoodSkuList(goodSku);
    }

    /**
     * 新增sku管理test
     *
     * @param goodSku sku管理test
     * @return 结果
     */
    @Override
    public int insertGoodSku(GoodSku goodSku) {
        goodSku.setCreateTime(DateUtils.getNowDate());
        return goodSkuMapper.insertGoodSku(goodSku);
    }

    /**
     * 修改sku管理test
     *
     * @param goodSku sku管理test
     * @return 结果
     */
    @Override
    public int updateGoodSku(GoodSku goodSku) {
        goodSku.setUpdateTime(DateUtils.getNowDate());
        return goodSkuMapper.updateGoodSku(goodSku);
    }

    /**
     * 批量删除sku管理test
     *
     * @param ids 需要删除的sku管理test主键
     * @return 结果
     */
    @Override
    public int deleteGoodSkuByIds(Long[] ids) {
        return goodSkuMapper.deleteGoodSkuByIds(ids);
    }

    /**
     * 删除sku管理test信息
     *
     * @param id sku管理test主键
     * @return 结果
     */
    @Override
    public int deleteGoodSkuById(Long id) {
        return goodSkuMapper.deleteGoodSkuById(id);
    }
}
